dict = {}
for i in xrange(1000000):
    dict[i * i] = 1

ans = 0
ansd = 0

for d in xrange(1, 1001):
    if d in dict or d in [61, 73]:
        continue
    print d
    y = 0
    while 1:
        y += 1
        if y > 1000000:
            break

        tx = 1 + d * y * y
        if tx in dict:
            if ans < tx:
                ans = tx
                ansd = d
            break

print ans ** 0.5
print ansd

